"""meiduo_mall URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include

# 总路由添加自定义用户名路由转换器
from django.urls import register_converter

from meiduo_mall.utils.converters import UsernameConverter
from meiduo_mall.utils.converters import MobileConverter

# 用户转换器
register_converter(UsernameConverter, 'username')
# 手机号转换器
register_converter(MobileConverter, 'mobile')

urlpatterns = [
    path('admin/', admin.site.urls),

    # 用户users模块总路由
    path('', include('apps.users.urls')),

    # 用户图形验证码总路由
    path('', include('apps.verifications.urls')),

    #qq登录
    path('', include('apps.oauth.urls')),

    #省市区三级联动
    path('', include('apps.areas.urls')),

    #测试首页
    path('', include('apps.contents.urls')),

    #商品数据
    path('', include('apps.goods.urls')),

    #购物车数据
    path('', include('apps.carts.urls')),

    #订单
    path('', include('apps.orders.urls')),

    #后台
    path('', include('apps.meiduo_admin.urls')),

]
